using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Gko.Wpf.Mvvm.Interfaces
{
	public interface IMediator<TMessageId> where TMessageId : IEquatable<TMessageId>
	{
		void Register<TValue>(TMessageId messageId, Action<TValue> action);
		void Notify<TValue>(TMessageId messageId, TValue value);
		void Notify<TValue>(TMessageId messageId, TValue value, MediatorOptions options);
		void NotifyAsync<TValue>(TMessageId messageId, TValue value);
		void Notify<TValue>(TMessageId messageId, TValue value, SynchronizationContext context);
		void Notify<TValue>(TMessageId messageId, TValue value, SynchronizationContext context, MediatorOptions options);
		void NotifyAsync<TValue>(TMessageId messageId, TValue value, SynchronizationContext context);
		TValue GetLastNotified<TValue>(TMessageId messageId, TValue defaultValue);
	}

	public interface IMediator<TMessageId, TSenderId> where TMessageId : IEquatable<TMessageId> where TSenderId : IEquatable<TSenderId>
	{
		void Register<TValue>(TMessageId messageId, TSenderId senderId, Action<TValue> action);
		void Notify<TValue>(TMessageId messageId, TSenderId senderId, TValue value);
		void Notify<TValue>(TMessageId messageId, TSenderId senderId, TValue value, MediatorOptions options);
		void NotifyAsync<TValue>(TMessageId messageId, TSenderId senderId, TValue value);
		void Notify<TValue>(TMessageId messageId, TSenderId senderId, TValue value, SynchronizationContext context);
		void Notify<TValue>(TMessageId messageId, TSenderId senderId, TValue value, SynchronizationContext context, MediatorOptions options);
		void NotifyAsync<TValue>(TMessageId messageId, TSenderId senderId, TValue value, SynchronizationContext context);
		TValue GetLastNotified<TValue>(TMessageId messageId, TSenderId senderId, TValue defaultValue);
	}
}